package org.abc.fund.service.trade;

import org.abc.fund.entity.trade.Settlement;
import org.abc.fund.repository.trade.SettlementRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class SettlementService {

  private final SettlementRepository settlementRepository;

  public SettlementService(SettlementRepository settlementRepository) {
    this.settlementRepository = settlementRepository;
  }

  @Transactional(readOnly = true)
  public List<Settlement> getSettlementsByOrderId(Long orderId) {
    return settlementRepository.findByTradeOrderId(orderId);
  }
}
